package com.nsoft.pdfrender;

import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.util.FeatureEnum;

/**
 * get report from EPUB checker 
 * @author minhld
 */
public class EpubReporter implements Report {
	int exceptionCount=0;
	int errorCount=0;
	int warningCount=0;
	String errorMessage="";
	
	public EpubReporter() {
		errorMessage="";
	}
	
	@Override
	public void warning(String arg0, int arg1, int arg2, String arg3) {
		System.out.println(arg3);
		warningCount++;
	}
	
	@Override
	public void info(String arg0, FeatureEnum arg1, String arg2) {
		
	}
	
	@Override
	public int getWarningCount() {
		return warningCount;
	}
	
	@Override
	public int getExceptionCount() {
		return exceptionCount;
	}
	
	@Override
	public int getErrorCount() {
		return errorCount;
	}
	
	@Override
	public void exception(String arg0, Exception arg1) {
		exceptionCount++;
	}
	
	@Override
	public void error(String arg0, int arg1, int arg2, String arg3) {
		errorMessage+=arg3+"\r\n";
		errorCount++;
	}
	
	public String getErrorMessage(){
		return errorMessage;
	}
}